// http://192.168.20.5:8080/api/v1/User/search
import httpAxios from "@/utilx/http/axios.ts";
import {PageResult, SearchById, SearchWithPage} from "@/typex";
import {AxiosResult, cloud} from "@/api/dto";

export namespace UserApi {
    const routeGroup = "user"
    export const UserSearch = async (data: SearchWithPage<any>): AxiosResult<PageResult<cloud.Traffic>> => httpAxios.post(routeGroup.concat("/search"), data)
    export const UserAdd = async (data: any): AxiosResult<boolean> => httpAxios.post(routeGroup.concat("/add"), data)
    export const UserUpd = async (data: any): AxiosResult<boolean> => httpAxios.post(routeGroup.concat("/upd"), data)
    export const UserGet = async (data: SearchById): AxiosResult<PageResult<cloud.Traffic>> => httpAxios.post(routeGroup.concat("/get"), data);
    export const Login = async (data: cloud.LoginReq): AxiosResult<any> => httpAxios.post(routeGroup.concat("/login"), data);


    //===========
    export const Info = async (): AxiosResult<any> => httpAxios.get(routeGroup.concat("/info"));
    export const Traffic = async (): AxiosResult<any> => httpAxios.get(routeGroup.concat("/traffic"));
    export const Order = async (): AxiosResult<any> => httpAxios.get(routeGroup.concat("/order"));
    export const Subscribe = async (): AxiosResult<any> => httpAxios.get(routeGroup.concat("/subscribe"));


}

